import { MongooseFactory } from '../kalend';
import { Schema } from 'mongoose';


const loginlogSchema = MongooseFactory.Schema({
    //登录平台
    com_platform: {
        type: String,
        enum: ['admin', 'app'],

    },
    //用户id
    userid: { type: Schema.Types.ObjectId, ref: 'userfull' },
    // 设备号
    uuid: { type: String },
    //登录时间
    logintime: {
        type: Date,
        default: Date.now
    },
    // 用户名
    username: String,
    // 地址
    area: String,
    dist: {
        type: String,
        default: ""
    },
    town: {
        type: String,
        default: ""
    },
    ip: {
        type: String
    }
});

export const loginlogModel = MongooseFactory.Model("loginlog", loginlogSchema);